package com.itheima.converter;

import com.itheima.dto.SetmealDTO;
import com.itheima.pojo.Setmeal;

public class SetmealConverter {
    /**
     * SetmealDTO对象转Setmeal对象
     */
    public static Setmeal SetmealDTOtoSetmeal(SetmealDTO setmealDTO) {
        Setmeal result = new Setmeal();
         result.setId(setmealDTO.getId());
         result.setName(setmealDTO.getName());
         result.setCode(setmealDTO.getCode());
         result.setHelpCode(setmealDTO.getHelpCode());
         result.setSex(setmealDTO.getSex());
         result.setAge(setmealDTO.getAge());
         result.setPrice(setmealDTO.getPrice().floatValue());
         result.setRemark(setmealDTO.getRemark());
         result.setAttention(setmealDTO.getAttention());
         result.setImg(setmealDTO.getImg());
         return result;
    }
}
